package com.CST.mapper.cst;

import com.CST.entity.BdSysMenu;
import com.CST.entity.BdSysRoleMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import javax.swing.plaf.basic.BasicListUI;
import java.util.List;

/**
 * <p>角色菜单 Mapper 接口</p>
 *
 * @author: y
 * @create: 2021-09-28 09:07
 **/
@Mapper
@Repository
public interface BdSysRoleMenuMapper extends BaseMapper<BdSysRoleMenu> {


    /**
     * <p>id查询</p >
     * @param id
     * @author y
     * @since 2021/09/28 09:50
     * @return com.CST.entity.BdSysRoleMenu
     */
    @Select("select * from BD_SysRoleMenu where id=#{id}")
    BdSysRoleMenu getSysRoleMenuById(@Param("id") String id);

    List<BdSysRoleMenu> getSysRoleMenuByRoleId(@Param("roleId") String roleId);

    @Delete("delete from BD_SysRoleMenu where ROLE_ID = #{roleId}")
    int deleteBySysMenuId(@Param("roleId") String roleId);

    /**
     * <p>更新角色菜单</p >
     * @param bdSysRoleMenu
     * @author y
     * @since 2021/09/28 10:15
     * @return int
     */
    boolean updateSysRoleMenu(BdSysRoleMenu bdSysRoleMenu);

    List<BdSysRoleMenu> getSysRoleMenu(@Param("roleId") String roleId,@Param("menuId") String menuId);

    List<BdSysMenu> selectRoleMenuById(String roleId);
}
